home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / System-Boost / Workbench / Archive / ViewDiz / NewModules / lha next >
AmigaDOS Script File  |  1998-11-08  |  2KB  |  71 lines

  1. .key FILE/A,CMD,DESC
  2. .def desc="t:file_id.diz"
  3. .bra {
  4. .ket }
  5.  
  6. if {cmd} eq "read"
  7.  failat 21
  8.  set note `list "{file}" lformat "%c"`
  9.  get >nil: note
  10.  
  11.  if not warn
  12.   get >T:file_id_diz.tmp note
  13.   rx "open(n,'T:file_id_diz.tmp');string=readln(n);close(n);string=STRIP(string);s=string;m=44;b=1;IF length(s)>m THEN DO n=1 by 1 for words(s);IF wordindex(s,n)+wordlength(s,n)-b>=m THEN DO;IF n=1 THEN leave;b=wordindex(s,n-1);s=insert('0a'x,s,b-1);END;END;open(n,'{DESC}','w');writeln(n,s);close(n)"
  14.   delete T:file_id_diz.tmp QUIET
  15.   unset note
  16.   skip end
  17.  endif
  18.  
  19.  lha e -X -m -a0 "{file}" file_id.diz T: >nil:
  20.  
  21.  if exists "{desc}"
  22.   skip end
  23.  else
  24.   set aminetfile "`list "{file}" LFORMAT %f%m`.readme"
  25.   if not exists "$aminetfile"
  26.    set aminetfile "`list "{file}" LFORMAT %m`.readme"
  27.    lha e -X -m -x0 "{file}" "#?$aminetfile" t: >NIL:
  28.    set aminetfile "t:"$aminetfile
  29.   endif
  30.   if exists "$aminetfile"
  31.    execute env:viewdiz/modules/readme "$aminetfile" CMD=read DESC="{desc}"
  32.    unset aminetfile
  33.   endif
  34.  endif
  35.  skip end
  36. endif
  37.  
  38. if {cmd} eq "write"
  39.  failat 21
  40.  set note `list "{file}" lformat "%c"`
  41.  lha r -X -q -m "{file}" "{desc}" >nil:
  42.  get >nil: note
  43.  if not warn
  44.   filenote >nil: "{file}" "$note"
  45.   unset note
  46.  endif
  47. endif
  48.  
  49. if {cmd} eq "DELETE"
  50.  failat 21
  51.  set note `list "{file}" lformat "%c"`
  52.  lha -X d "{file}" file_id.diz >nil:
  53.  get >nil: note
  54.  if not warn
  55.   filenote >nil: "{file}" "$note"
  56.   unset note
  57.  endif
  58. endif
  59.  
  60. if {cmd} eq "execute"
  61.  execute env:viewdiz/modules/.getdrawer
  62.  lha x -X -a -m -M "{file}" "$dest" >con:
  63. endif
  64.  
  65. if {cmd} eq "info"
  66.  setenv viewdiz/.minf "*"{file}*"" rwxd 6 _UnLha (#?.lha|#?.lzh) Lha-Archive
  67. endif
  68.  
  69. lab end
  70. ;$VER: ViewDIZ-LHA.module 1.3 (23.10.98) Mikael Lund & Stefano Pucino
  71.